
int depth(TreeNode* pRoot)
{
    if (pRoot == nullptr)
    {
        return 0;
    }
    int left = depth(pRoot->left);
    int right = depth(pRoot->right);
    return max(left, right) + 1;
}
bool judge(TreeNode* pRoot) 
{
    if (pRoot == nullptr)
    {
        return true;
    }
    return abs(depth(pRoot->left) - depth(pRoot->right)) <= 1 && judge(pRoot->left) && judge(pRoot->right);
}
bool IsBalanced_Solution(TreeNode* pRoot) 
{
    return judge(pRoot);
}


